# ————————————————————  4.3.1条件循环：while语句  ————————————————————
# n = int(input("请输入一个整数："))
# fact = 1
# i = 1
# while i <= n:
# 	fact = fact * i
# 	i = i + 1
# print("n!={}".format(fact))

# n = int(input("请输入一个整数："))
# fact = 1
# i = 1
# while i <= n:
#     fact = fact * i
#     i = i + 1
# else:
#     print("计算完成，循环正常结束")
# print("n!={}".format(fact))


# ————————————————————  4.3.2遍历循环：for语句  ————————————————————
# string = "人人为我，我为人人"
# for c in string:
#     print(c)

# string = "人人为我，我为人人"
# for i in range(len(string)):  # 通过range()函数生成整数列表
#     print(string[i])

# string = "人人为我，我为人人"
# for i in range(len(string)):
#     print(string[i])
# else:
#     print("循环正常结束")


# ————————————————————  4.3.3实例：天天向上的力量  ————————————————————
# hard_capability_value = 1.0     # 努力的能力值
# free_capability_value = 1.0     # 放任的能力值
# days = 365
# while days > 0:
#     hard_capability_value += hard_capability_value * 0.009
#     free_capability_value -= free_capability_value * 0.009
#     days -= 1
# print(f"努力一年后，能力值为：{hard_capability_value}")
# print(f"放任一年后，能力值为：{free_capability_value}")
# print("努力一年的能力值是放任一年的 %.2f 倍"%(hard_capability_value /
#                                                  free_capability_value))


# ————————————————————  4.3.4循环嵌套  ————————————————————
# i = 1
# while i < 6:                    # 外层循环，用于控制图形的行数
#     j = 0
#     while j < i:                # 内层循环，用于控制每行*的数量
#         print("*", end='')     # 输出*，指定*后面的结束标注是空
#         j += 1
#     print()                      # 每输出完一行*便换行
#     i += 1

# for i in range(1, 6):
#     for j in range(i):
#         print("*", end='')
#     print()


# ————————————————————  4.3.5循环控制  ————————————————————
# n = int(input("请输入一个整数："))
# fact = 1
# i = 1
# while i <= n:
#     fact = fact * i
#     i = i + 1
#     if i == 4:
#         break                  # 使用break跳出整个循环
# print("n!={}".format(fact))

# string = "人人为我，我为人人"
# for c in string:
#     if c == "，":
#         break                  # 使用break跳出整个循环
#     print(c)

# string = "人人为我，我为人人"
# for c in string:
#     if c == "，":
#         continue                  # 使用continue跳出本次循环
#     print(c)
# n = 3
# flag = 0
# for i in range(2,n):
#     if n%i == 0:
#         flag=1
#         break
# if flag==0 and n>1:
#     print(str(n)+"是素数")
# for n in range(1,100+1):
#     flag = 0
#     for i in range(2,n):
#         if n%i == 0:
#             flag=1
#             break
#     if flag==0 and n>1:
#         print(str(n)+"是素数")
def f(n):
    flag = 0
    for i in range(2,n):
        if n%i == 0:
            flag=1
            break
    if flag==0 and n>1:
        print(str(n)+"是素数")

for x in range(1,100+1):
    f(x)